package com.aspose.cells;

import java.util.ArrayList;

public class ProtectedRangeCollection extends CollectionBase {
   private Worksheet b;

   ProtectedRangeCollection(Worksheet sheet) {
      this.b = sheet;
   }

   public ProtectedRange get(int index) {
      return (ProtectedRange)this.a.get(index);
   }

   public int add(String name, int startRow, int startColumn, int endRow, int endColumn) {
      if (name == null) {
         throw new CellsException(6, "Name of AllowEditRange cannot be null");
      } else {
         zakq.a(startRow, startColumn, endRow, endColumn);
         CellArea var6 = new CellArea();
         var6.StartRow = startRow;
         var6.StartColumn = startColumn;
         var6.EndRow = endRow;
         var6.EndColumn = endColumn;
         ProtectedRange var7 = new ProtectedRange(this, name, var6);
         com.aspose.cells.b.a.a.ze.a(this.a, (Object)var7);
         return this.getCount() - 1;
      }
   }

   int a(ProtectedRange var1) {
      com.aspose.cells.b.a.a.ze.a(this.a, (Object)var1);
      return this.getCount() - 1;
   }

   int a(String var1, ArrayList var2) {
      if (var1 == null) {
         throw new CellsException(6, "Name of AllowEditRange cannot be null");
      } else {
         ProtectedRange var3 = new ProtectedRange(this, var1, var2);
         com.aspose.cells.b.a.a.ze.a(this.a, (Object)var3);
         return this.getCount() - 1;
      }
   }

   void a(ProtectedRangeCollection var1) {
      this.a.clear();

      for(int var2 = 0; var2 < var1.getCount(); ++var2) {
         ProtectedRange var3 = var1.get(var2);
         ProtectedRange var4 = new ProtectedRange(this);
         var4.a(var3);
      }

   }
}
